<template>
    <div class="view">
        <div class="page-rule">
            <div class="m-header">
                <div class="logo">
                    <img src="~@/assets/img/logo.png" alt="">
                </div>
                <div class="up-num">已有 <span>{{peopleNum > 9999 ? (Math.floor(peopleNum/1000)/10) + '万' : peopleNum}}</span> 名参与</div>
            </div>
            <div class="m-con">
                <div class="u-title">初赛</div>
                <div class="ruleImg" v-if="actInfo.stagesImages">
                    <img v-lazy="actInfo.stagesImages">
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import * as api from '@/api/index';
export default {
    name: "rule",
    data(){
        return{
            userInfo: JSON.parse(localStorage.getItem("userInfo")),
            actInfo:{},
            peopleNum: 0,

        }
    },
    watch:{
        
    },
    created(){ 
        this.getInit()
    },
    mounted(){
    },
    methods:{
        
        /*****
		 * 获取活动信息
		 * sstUserType: 1管理 2教师 3学生
         * getInfoById:按照阶段号查询阶段信息 ->报名开始时间到结束时间
         * getEnrollNum: 获取总的参与人数
		 * ****/ 
        async getInit(){
            var [res1,res2] = await Promise.all([
                                    api.getInfoById({stagesId: this.userInfo.stagesId}),
                                    api.getEnrollNum({futureId: this.userInfo.futureId})])
            if(res1.resultCode == 1){
                this.actInfo = res1.value?res1.value:{}
            }  
            if(res2.resultCode == 1){
                this.peopleNum = res2.value?res2.value:0
            }            
        },

        
    }
}
</script>
<style type="text/css" scoped>
.index-page{
  background-color:#eaeee8;
}
</style>